package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.entity.Approvals;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ApprovalsMapper extends BaseMapper<Approvals> {
    /**
     * 通过申请id查询申请实例
     * @param id
     * @return
     */
    @Select("select final_status from approvals where request_id=#{id} and approval_type=2")
    Integer selectByRequestId(Integer id);

    @Select("select * from approvals where approval_id=#{approvalId}")
    Approvals selectByApprovalId(Integer approvalId);
}